<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>分支练习</title>
    <script>
      //获取当前系统时间的小时
      let hour = new Date().getHours()
      if (hour < 11) {
        document.write('上午好!')
      } else if (hour < 13) {
        document.write('中午好!')
      } else {
        document.write('晚上好!')
      }

      let num = prompt('请您输入一个数字: ')
      if (num % 2 == 0) {
        document.write(num + '是偶数.')
      } else {
        document.write(num + '是奇数.')
      }
    </script>
  </head>
  <body></body>
</html>
